export function filePares(file, type = "base64") {
  return new Promise(resolve => {
    let fileRead = new FileReader();
    if (type === "base64") {
      fileRead.readAsDataURL(file);

    } else if (type === "buffer") {
      fileRead.readAsArrayBuffer(file)
    }
    fileRead.onload = ev => {
      // console.log(ev.target.result);
      resolve(ev.target.result)
    };
  })
}